package com.dongdongshop.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer;

@Configuration
public class FreemarkerConfig {
    @Value("${freemarker.templateLoderPath}")
    private String templateLoderPath;

    @Bean
    public FreeMarkerConfigurer getFree(){
        FreeMarkerConfigurer configurer  = new FreeMarkerConfigurer();
        configurer.setTemplateLoaderPath(templateLoderPath);
        configurer.setDefaultEncoding("utf-8");
        return configurer;
    }
}
